#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include<algorithm>
#include <queue>
#include <string>

using namespace std;

void Test1()
{
	vector<int> v = { 3,6,8,3,2,4,5,6,1,0,9,5 };
	set<int> s(v.begin(), v.end());
	auto it = s.begin();

}

struct cmp
{
	bool operator()(const pair<string, int>& m1, const pair<string, int>& m2)
	{
		return m1.second > m2.second;
	}
};

vector<string> topKFrequent(vector<string>& words, int k) {
	map<string, int> m;
	for (auto& e : words)
	{
		m[e]++;
	}

	vector<pair<string, int>> v(m.begin(), m.end());
	stable_sort(v.begin(), v.end(), cmp());

	vector<string> str;
	for (auto& e : v)
	{
		str.push_back(e.first);
	}

	return str;
}

void Test2()
{
	vector<string> s = { "i","love","leetcode","i","love","coding" };
	map<string, int> m;
	for (auto& e : s)
	{
		m[e]++;
	}

	for (auto& e : m)
	{
		cout << e.first << " : " << e.second << endl;
	}
	cout << endl;


	// sort(m.begin(), m.end(), cmp<>());

	vector<string> v2;
	for (auto& e : m)
	{
		v2.push_back(e.first);
	}
	
	for (string i : v2)
	{
		cout << i << " ";
	}
	cout << endl;




}


int main()
{
	string str;
	getline(cin, str);
	string str1;
	map<string, int> m;

	for (int i = 0; i < str.size(); i++)
	{
		if (str[i] >= 'A' && str[i] <= 'Z')
		{
			str[i] += 32;
		}
		if (str[i] == ' ' || str[i] == '\n' || str[i] == ',' || str[i] == '.')
		{
			m[str1]++;
			str1.clear();
		}
		else
		{
			str1 += str[i];
		}
	}

	vector<pair<string, int>> v(m.begin(), m.end());

	stable_sort(v.begin(), v.end(), cmp());
	for (auto& e : v)
	{
		cout << e.first << ":" << e.second << endl;
	}

	return 0;
}
